package factory;

import java.util.logging.Logger;

public class IntermediaryImpl implements Buyer{
    private final Buyer target;
    private Logger logger = Logger.getLogger(String.valueOf(IntermediaryImpl.class));

    /**
     * 被代理的目标对象
     * @return
     */
    private Buyer buyer;

    public IntermediaryImpl(Buyer target){
        this.target = target;
    }

    /**
     * 对目标对象业务进行代理
     * @return
     */
    @Override
    public String havealook() {
        before();
        String feedback = target.havealook();
        after();
        return "看房记录:买房反馈”"+feedback+"“";
    }

    private void after() {
        logger.info("后期跟踪");
        logger.info("和买家沟通意见。");
    }

    private void before() {
        logger.info("前期准备");
        logger.info("查找房源");
        logger.info("和卖家沟通时间。");
    }

}
